﻿using Ec_System.Models.Web;
using Ec_System.Service.Web;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Ec_System.Bll.Web
{
    public class EvaluationManager
    {
        EvaluationService evaluationService = new EvaluationService();

        /// <summary>
        /// 根据商品的ID获取其的评论
        /// </summary>
        /// <param name="productID"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        public List<EvaluationData> GetEvaluationByProductID(int productID, int pageIndex, int pageSize)
        {
            return evaluationService.GetEvaluationByProductID(productID, pageIndex, pageSize);
        }

        /// <summary>
        /// 添加评论
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public int AddEvaluation(EvaluationData model)
        {
            return evaluationService.AddEvaluation(model);
        }

        // <summary>
        /// 获取评论列表(带分页)
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public EvaluationResponseData GetEvaluationListWithPage(EvaluationRequestData request)
        {
            return evaluationService.GetEvaluationListWithPage(request);
        }

        // <summary>
        /// 根据ID获取明细
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public EvaluationData GetEvaluationDetailByID(int id)
        {
            return evaluationService.GetEvaluationDetailByID(id);
        }
    }
}
